{include file="common/top" /}
<style>
html{
	background: #ffffff;
}
.layui-form-label{
	width: 10%;
}
</style>
<form class="layui-form " action="" style="background: #fff;">
	<div class="layui-form-item">
		<label class="layui-form-label">退款编号：</label>
		<div class="layui-col-xs4">
			<input type="text" readonly="readonly" name="code" value="{$num}" lay-verify="required" autocomplete="off" class="layui-input">
		</div>
		<!-- <label class="layui-form-label">退款时间：</label>
		<div class="layui-col-xs4">
			<input type="text" name="create_time" id="date" lay-verify="datetime" placeholder="yyyy-MM-dd H:i:s" autocomplete="off" class="layui-input">
		</div> -->
	</div>
	
	<div class="layui-form-item">
		<label class="layui-form-label">客户姓名：</label>
		<div class="layui-col-xs4">
			<select name="customer_id" lay-verify="required" lay-search=""  lay-verify="required" autocomplete="off" >
				<option value="">直接选择或搜索选择</option>
				{volist name="cu_list" id='cu'}
					<option value="{$cu.id}" >{$cu.name}，余额：{$cu.prepare_money}</option>
				{/volist}
	        </select>
		</div>
		
		<label class="layui-form-label">退款金额：</label>
		<div class="layui-col-xs4">
			<input type="text" name="amount" lay-verify="required" autocomplete="off" placeholder="请输入退款金额" class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
        <label class="layui-form-label">收款人姓名：</label>
        <div class="layui-col-xs4">
            <input type="text" name="cardholder" autocomplete="off" placeholder="请输入收款人姓名" class="layui-input">
        </div>
    </div>
	<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
	  	<legend>银行卡信息</legend>
	</fieldset>
	<div class="layui-form-item">
        <label class="layui-form-label">银行卡号：</label>
        <div class="layui-col-xs4">
            <input type="text" name="card_number" autocomplete="off" placeholder="请输入银行卡号" class="layui-input">
        </div>
      	<label class="layui-form-label">开户行地址：</label>
        <div class="layui-col-xs4">
            <input type="text" name="bank_name" autocomplete="off" placeholder="请输入开户行地址" class="layui-input">
        </div>
    </div>
    
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
	  	<legend>支付宝信息</legend>
	</fieldset>
    <div class="layui-form-item">
        <label class="layui-form-label">支付宝账号：</label>
        <div class="layui-col-xs4">
            <input type="text" name="zfb_num" autocomplete="off" placeholder="请输入支付宝账号" class="layui-input">
        </div>
    </div>
    
    <hr/>
	<div class="layui-form-item">
		<label class="layui-form-label">备注：</label>
		<div class="layui-col-xs9">
			<textarea name="note" autocomplete="off" placeholder="请输入详细备注" class="layui-textarea"></textarea>
		</div>
	</div>
	<hr />
	<div class="layui-form-item">
		<div class="layui-input-block">
			<button class="layui-btn"  lay-submit="" lay-filter="demo1">提交</button>
		</div>
	</div>
	
</form>
{include file="common/footer" /}
<script>
	var t = new Date().getTime();
	layui.use(['form', 'layedit', 'laydate'], function(){
		
		  var form = layui.form ,layer = layui.layer,laydate = layui.laydate;
		  laydate.render({
			    elem: '#date', //指定元素
			    type: 'datetime',
			    value: new Date(t)
			  });
		  //监听提交
		  form.on('submit(demo1)', function(data){
			var articleFrom = data.field;
			layer.load(1, { shade : [ 0.5, '#676a6c' ] }); 
			$.post("{:url('add_cu_refund')}?t=json",articleFrom,function(data){
				layer.closeAll();
				if (data['code'] == 1) { 
					var index1 = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
					parent.layer.close(index1); //再执行关闭 
					//父页面数据 ，重新加载
					parent.get_s(data['msg']);

				} else {
					layer.msg(data['msg'], { icon : 5 });
				}
			});
			
			return false;
		  });
		  
		  
		 
		});
	
</script>
